#define _CRT_SECURE_NO_WARNINGS   1

#include<iostream>
#include<vector>

using namespace std;

class Solution
{
public:
	int search(vector<int>& nums, int target)
	{
		int begin = 0;
		int end = nums.size() - 1;
		while (begin <= end)
		{
			int m = (begin + end) / 2;
			if (nums[m] == target)
				return m;
			if (nums[m] > target)
				end = m - 1;
			else
				begin = m + 1;
		}
		return -1;
	}
};


int main()
{
	Solution sol;
	int num;
	vector<int>a;
	int t;
	while (cin.get() != '\n')
	{
		cin >> num;
		a.push_back(num);
	}
	cin >> t;
	cout<<sol.search(a, t)<<endl;
	return 0;
}